

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>Use a Pattern [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Use,Use Pattern,Add,Add Pattern To Diagram,Add UML Pattern To Diagram,UML Pattern,UML Pattern Add To Diagram,Pattern,Pattern Action, Modify,Pattern Default, Change,Edit,Edit Pattern Default,Set,Set Element Classifier">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">Use a Pattern</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="importapattern.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="mdgtechnologies.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_BodyText"><span class="f_BodyText">Using a Pattern enables you to use items defined in the Pattern with the UML model. Using Patterns enables you to rapidly create template solutions for code structures that perform the same type of task in other situations.</span></p>
<p class="p_BodyText"><span class="f_BodyText">To use a Pattern that you have <a href="importapattern.htm">previously imported</a> into the model, follow the steps below:</span></p>
<ol style="text-indent: 0px; margin-left: 48px; list-style-position: outside;">
<li value=1><span class="f_NumberedList">Open the diagram into which to add the UML Pattern.</span></li>
<li value=2><span class="f_NumberedList">Select the </span><span class="f_UIControl">Resources</span><span class="f_NumberedList"> window.</span></li>
<li value=3><span class="f_NumberedList">Expand the </span><span class="f_NumberedList" style="font-style: italic;">UML Pattern</span><span class="f_NumberedList"> folder and find the Pattern to add.</span></li>
<li value=4><span class="f_NumberedList">Either:</span></li>
</ol>
<ul style="text-indent: 0px; margin-left: 65px; list-style-position: outside;">
<li><span class="f_Bulletlist3">Right-click on the Pattern and select the </span><span class="f_MenuKeyField">Add Pattern to Diagram</span><span class="f_Bulletlist3"> menu option or</span></li>
<li><span class="f_Bulletlist3">Drag and drop the Pattern from the </span><span class="f_UIControl">Resources</span><span class="f_Bulletlist3"> window onto the diagram.</span></li>
</ul>
<p class="p_Bulletlist3"><span class="f_Bulletlist3">(You can also view the Pattern details in read-only mode by selecting the </span><span class="f_MenuKeyField">View Pattern Details</span><span class="f_Bulletlist3"> menu option.)</span><br>
<span class="f_Bulletlist3">&nbsp;</span></p>
<p class="p_Bulletlist3"><span class="f_Bulletlist3">The </span><span class="f_UIControl">Add Pattern</span><span class="f_Bulletlist3"> dialog displays.</span><br>
<span class="f_Bulletlist3">&nbsp;</span></p>
<p class="p_Bulletlist3"><img src="addpatternelements.png" width="625" height="380" border="0" alt="AddPatternElements"><br>
<span class="f_Bulletlist3">&nbsp;</span></p>
<div style="text-align: left; text-indent: -21px; padding: 0px 0px 0px 0px; margin: 5px 0px 0px 48px;"><table cellspacing="0" cellpadding="0" border="0" style="border: none; border-spacing:0px; border-collapse: collapse;">
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="115" bgcolor="#e3e6ed" style="width:115px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Panel</span></p>
</td>
<td valign="top" width="540" bgcolor="#e3e6ed" style="width:540px; background-color:#e3e6ed; border: solid 1px #000000;"><p class="p_Tableheader"><span class="f_Tableheader">Use to</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="115" style="width:115px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_UIControl">Preview</span></p>
</td>
<td valign="top" width="540" style="width:540px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Display a preview of the Pattern; click on the </span><span class="f_MenuKeyField">Preview</span><span class="f_Tabletext"> link to open a view of the Pattern and drag the sides into as large a picture as you require.</span></p>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="115" style="width:115px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_UIControl">Pattern Elements</span></p>
</td>
<td valign="top" width="540" style="width:540px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Access the individual elements contained in the Pattern.</span></p>
<p class="p_Tabletext"><span class="f_Tabletext">From here you can:</span></p>
<ul style="text-indent: 0px; margin-left: 15px; list-style-position: outside;">
<li><span class="f_Tabletext">select the action for the individual element (</span><span class="f_Tabletext" style="font-style: italic;">Create</span><span class="f_Tabletext">, </span><span class="f_Tabletext" style="font-style: italic;">Merge</span><span class="f_Tabletext">, </span><span class="f_Tabletext" style="font-style: italic;">Instance</span><span class="f_Tabletext"> or </span><span class="f_Tabletext" style="font-style: italic;">Type,</span><span class="f_Tabletext"> as applicable for each element) by clicking on the drop-down arrow, or</span></li>
</ul>
<ul style="text-indent: 0px; margin-left: 15px; list-style-position: outside;">
<li><span class="f_Tabletext"><a href="useapattern.htm#Modify">modify</a> the default of the Pattern element or - for a merged element - choose the namespace, by clicking on the </span><span class="f_MenuKeyField">[ ... ]</span><span class="f_Tabletext"> button on the right of the </span><span class="f_Tabletext" style="font-weight: bold;">Default</span><span class="f_Tabletext"> entry.</span></li>
</ul>
</td>
</tr>
<tr style="text-align:left;vertical-align:top;">
<td valign="top" width="115" style="width:115px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_UIControl">Element Notes</span></p>
</td>
<td valign="top" width="540" style="width:540px; border: solid 1px #000000;"><p class="p_Tabletext"><span class="f_Tabletext">Display the comments that describe the element in the Pattern. Highlight an element in the </span><span class="f_UIControl">Pattern Elements</span><span class="f_Tabletext"> panel to view the notes.</span></p>
</td>
</tr>
</table>
</div>
<p class="p_NumberedList"><span class="f_Bulletlist3">&nbsp;</span></p>
<ol style="text-indent: 0px; margin-left: 48px; list-style-position: outside;">
<li value=5><span class="f_NumberedList">Once the appropriate selections have been made, click on the </span><span class="f_MenuKeyField">OK</span><span class="f_NumberedList"> button to import the Pattern into the model, recreating the original diagram with new GUIDs.</span></li>
</ol>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Change Pattern Element Default<a name="modify"></a></span></p>
<p class="p_BodyText"><span class="f_BodyText">To change the default of the Pattern element, follow the steps below:</span></p>
<ol style="text-indent: 0px; margin-left: 48px; list-style-position: outside;">
<li value=1><span class="f_NumberedList">From the </span><span class="f_UIControl">Add Pattern</span><span class="f_NumberedList"> dialog select the individual element in the </span><span class="f_UIControl">Pattern Element</span><span class="f_NumberedList"> panel.</span></li>
<li value=2><span class="f_NumberedList">Click on the </span><span class="f_MenuKeyField">[ ... ] </span><span class="f_NumberedList">button to display the </span><span class="f_UIControl">Edit</span><span class="f_NumberedList"> dialog. The specific method for changing the element name is dependant upon the entry in the </span><span class="f_MenuKeyField">Action</span><span class="f_NumberedList"> column of the </span><span class="f_UIControl">Pattern Elements</span><span class="f_NumberedList"> panel.</span></li>
<li value=3><span class="f_NumberedList">If the </span><span class="f_MenuKeyField">Action</span><span class="f_NumberedList"> entry is </span><span class="f_MenuKeyField">Create</span><span class="f_NumberedList">, then in the </span><span class="f_MenuKeyField">Default</span><span class="f_NumberedList"> field in the </span><span class="f_UIControl">Edit</span><span class="f_NumberedList"> dialog delete the existing value and type your own, user-defined value. Click on the </span><span class="f_MenuKeyField">OK</span><span class="f_NumberedList"> button. The element default is updated on the </span><span class="f_UIControl">Add Pattern</span><span class="f_NumberedList"> dialog.</span></li>
<li value=4><span class="f_NumberedList">If the </span><span class="f_MenuKeyField">Action</span><span class="f_NumberedList"> entry for the element is </span><span class="f_MenuKeyField">Merge</span><span class="f_NumberedList">, in the </span><span class="f_UIControl">Edit</span><span class="f_NumberedList"> dialog click on the </span><span class="f_MenuKeyField">[ ... ]</span><span class="f_NumberedList"> button to browse to an existing element classifier. The </span><span class="f_UIControl">Set Element Classifier</span><span class="f_NumberedList"> dialog displays.</span><br>
<span class="f_NumberedList">&nbsp;</span><br>
<img src="setelementclassifier.png" width="555" height="375" border="0" alt="SetElementClassifier"><br>
<span class="f_NumberedList">&nbsp;</span></li>
<li value=5><span class="f_NumberedList">Select an existing element classifier from the </span><span class="f_UIControl">Classifier</span><span class="f_NumberedList"> list. You can restrict the number of choices by selecting the elements from a specific namespace; to do this, click on the </span><span class="f_MenuKeyField">In Namespace</span><span class="f_NumberedList"> drop-down arrow and select a namespace. For more information regarding setting element classifiers see the </span><span class="f_NumberedList" style="font-style: italic;"><a href="usingclassifiers.htm">Using Classifiers</a></span><span class="f_NumberedList"> topic.</span></li>
</ol>




            </div>
          </div>
        </div>



</div>


</body>
</html>
